/////////////////////////////////////////////////////////////////////////////
// Name:        systemsdialog.hpp
// Purpose:     
// Author:      Erwan Le Martelot
// Modified by: 
// Created:     20/04/2007 11:23:00
// RCS-ID:      
// Copyright:   
// Licence:     
/////////////////////////////////////////////////////////////////////////////

#ifndef _SYSTEMSDIALOG_H_
#define _SYSTEMSDIALOG_H_

#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "systemsdialog.hpp"
#endif

/*!
 * Includes
 */

////@begin includes
#include "wx/listctrl.h"
////@end includes

// ----- My Includes ----- //
#include "SCProgram.hpp"
#include "SCSystem.hpp"
#include <vector>
// ----------------------- //

/*!
 * Forward declarations
 */

////@begin forward declarations
class wxListView;
////@end forward declarations

/*!
 * Control identifiers
 */

////@begin control identifiers
#define ID_SYSTEMS_DIALOG 10004
#define ID_LISTVIEW 10000
#define ID_HIDE_SYSTEMS_BUTTON 10009
#define SYMBOL_SYSTEMSDIALOG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxMAXIMIZE_BOX|wxMINIMIZE_BOX
#define SYMBOL_SYSTEMSDIALOG_TITLE _("Systems")
#define SYMBOL_SYSTEMSDIALOG_IDNAME ID_SYSTEMS_DIALOG
#define SYMBOL_SYSTEMSDIALOG_SIZE wxSize(820, 600)
#define SYMBOL_SYSTEMSDIALOG_POSITION wxDefaultPosition
////@end control identifiers

/*!
 * Compatibility
 */

#ifndef wxCLOSE_BOX
#define wxCLOSE_BOX 0x1000
#endif

/*!
 * SystemsDialog class declaration
 */

class SystemsDialog: public wxFrame
{    
	DECLARE_DYNAMIC_CLASS( SystemsDialog )
	DECLARE_EVENT_TABLE()

public:
	/// Constructors
	SystemsDialog();
	SystemsDialog( wxWindow* parent, wxWindowID id = SYMBOL_SYSTEMSDIALOG_IDNAME, const wxString& caption = SYMBOL_SYSTEMSDIALOG_TITLE, const wxPoint& pos = SYMBOL_SYSTEMSDIALOG_POSITION, const wxSize& size = SYMBOL_SYSTEMSDIALOG_SIZE, long style = SYMBOL_SYSTEMSDIALOG_STYLE );

	/// Creation
	bool Create( wxWindow* parent, wxWindowID id = SYMBOL_SYSTEMSDIALOG_IDNAME, const wxString& caption = SYMBOL_SYSTEMSDIALOG_TITLE, const wxPoint& pos = SYMBOL_SYSTEMSDIALOG_POSITION, const wxSize& size = SYMBOL_SYSTEMSDIALOG_SIZE, long style = SYMBOL_SYSTEMSDIALOG_STYLE );

	/// Destructor
	~SystemsDialog();

	/// Initialises member variables
	void Init();

	/// Creates the controls and sizers
	void CreateControls();

////@begin SystemsDialog event handler declarations

	/// wxEVT_CLOSE_WINDOW event handler for ID_SYSTEMS_DIALOG
	void OnCloseWindow( wxCloseEvent& event );

	/// wxEVT_COMMAND_LIST_ITEM_ACTIVATED event handler for ID_LISTVIEW
	void OnListviewItemActivated( wxListEvent& event );

	/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_HIDE_SYSTEMS_BUTTON
	void OnHideSystemsButtonClick( wxCommandEvent& event );

////@end SystemsDialog event handler declarations

////@begin SystemsDialog member function declarations

	/// Retrieves bitmap resources
	wxBitmap GetBitmapResource( const wxString& name );

	/// Retrieves icon resources
	wxIcon GetIconResource( const wxString& name );
////@end SystemsDialog member function declarations

	/// Should we show tooltips?
	static bool ShowToolTips();

////@begin SystemsDialog member variables
	wxListView* systemsList;
////@end SystemsDialog member variables

protected:
	void initSystemsList(const SC::SCProgram &);
	std::string cutWord(const std::string &) const;

public:
	void SetData(const SC::SCProgram &, const std::vector<SC::SCSystem> &);
	void Update(const unsigned int, const SC::SCSystem &);
	void UpdateAllData(const std::vector<SC::SCSystem> &);
};

#endif
	// _SYSTEMSDIALOG_H_
